package com.itstudy.anno;

import com.itstudy.validation.StateValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {StateValidation.class})//指定提供校验规则的类
public @interface State {
    String message() default "发布状态必须为已发布|草稿";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
